package com.example.springbootdemo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;

@SpringBootApplication
public class SpringBootDemoApplication implements EnvironmentAware {

    public static void main(String[] args) {
        SpringApplication.run(SpringBootDemoApplication.class, args);
    }

    @Override
    public void setEnvironment(Environment environment) {
        System.out.println("--------- environment start ---------");
        System.out.println("app.author: " + environment.getProperty("app.author"));
        System.out.println("app.name: " + environment.getProperty("app.name"));
        System.out.println("app.desc: " + environment.getProperty("app.desc"));
        System.out.println("app.version: " + environment.getProperty("app.version"));
        System.out.println("app.env: " + environment.getProperty("app.env"));
        System.out.println("redis.host: " + environment.getProperty("spring.redis.host"));
        System.out.println("--------- environment end ---------");
    }
}
